
import 'package:flutter/material.dart';

class AppBarDemo extends StatelessWidget{
  @override
  Widget build(BuildContext context) {
    // TODO: implement build
   return AppBar(
     toolbarHeight: 100,
     title: Text("我是中间标题"),
     actions: [
       Icon(Icons.abc_outlined, size: 28),
       Icon(Icons.abc_outlined, size: 28),
       Icon(Icons.abc_outlined, size: 28),
       Icon(Icons.abc_outlined, size: 28),
       Icon(Icons.abc_outlined, size: 28),
     ],
     leading: Builder(
       builder: (context) {
         return IconButton(
           onPressed: () {
             Scaffold.of(context).openDrawer();
           },
           icon: Icon(Icons.back_hand),
         );
       },
     ),
     toolbarTextStyle: TextStyle(fontSize: 1000),
     toolbarOpacity: 0.5,
     centerTitle: true,
     elevation: 10,
     bottom: TabBar(
       splashBorderRadius: BorderRadius.all(Radius.zero),
       dividerHeight: 0,
       indicatorSize: TabBarIndicatorSize.tab,
       indicator: UnderlineTabIndicator(
         borderRadius: BorderRadius.circular(10),
       ),
       padding: EdgeInsetsGeometry.only(bottom: 10),
       indicatorWeight: 6,
       indicatorColor: Colors.pink,
       indicatorAnimation: TabIndicatorAnimation.elastic,
       indicatorPadding: EdgeInsets.zero,
       // 移除指示器内边距
       unselectedLabelColor: Colors.black26,
       labelColor: Colors.red,
       tabs: <Widget>[
         Tab(
           child: Row(
             children: [
               Text("tab1"),
               SizedBox(
                 width: 12,
                 height: 12,
                 child: Image.asset(
                   "images/pic6.jpg",
                   fit: BoxFit.cover,
                 ),
               ),
             ],
             mainAxisAlignment: MainAxisAlignment.center,
           ),
         ),
         Tab(
           icon: ImageIcon(AssetImage("images/pic3.jpg")),
           child: Row(
             children: <Widget>[Text("tab2")],
             mainAxisAlignment: MainAxisAlignment.center,
           ),
         ),
         Tab(child: Row(children: <Widget>[Text("tab3")])),
         Tab(child: Row(children: <Widget>[Text("tab4")])),
       ],
     ),
   );
  }

}